import request from '@/utils/request'

// 查询限时抢购列表
export function listPanicbuying(query) {
  return request({
    url: '/market/panicbuying/list',
    method: 'get',
    params: query
  })
}
// 查询限时抢购列表
export function panicbuyList(query) {
  return request({
    url: '/market/panicbuying/panicbuyList',
    method: 'get',
    params: query
  })
}

// 查询限时抢购详细
export function getPanicbuying(id) {
  return request({
    url: '/market/panicbuying/' + id,
    method: 'get'
  })
}

// 新增限时抢购
export function addPanicbuying(data) {
  return request({
    url: '/market/panicbuying',
    method: 'post',
    data: data
  })
}

// 修改限时抢购
export function updatePanicbuying(data) {
  return request({
    url: '/market/panicbuying',
    method: 'put',
    data: data
  })
}

// 删除限时抢购
export function delPanicbuying(id) {
  return request({
    url: '/market/panicbuying/' + id,
    method: 'delete'
  })
}
// 状态修改
export function changePanicbuyingStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/market/panicbuying/changeStatus',
    method: 'put',
    data: data
  })
}
